package com.example.yilanchatserver.business.freechat.service.impl;

public class RedisSelectSupport {
    private static final InheritableThreadLocal<Integer> SELECT_CONTEXT = new InheritableThreadLocal<>();

    public static void select(int db) {
        SELECT_CONTEXT.set(Integer.valueOf(db));
    }
    //InheritableThreadLocal类在整个线程中存在，可以随时调用，随着线程的销毁而销毁

    public static Integer getSelect() {
        return SELECT_CONTEXT.get();
    }
}
